﻿using System;
namespace SieveConsole
{
    public class Program
    {
        public static void Main(string[] args)
        {
            int n = 100;
            bool[] primeNum = new bool[101];
            for(int i = 0; i <= n; i++)
            {
                primeNum[i] = true;
            }

            for(int i = 2; i <= n; i++)
            {
                if (primeNum[i] == false)
                    continue;
                for(int j = 2*i; j <= n; j += i)
                {
                    primeNum[(int)j] = false;
                }
            }
            Console.WriteLine("100以内的素数为：");
            for(int i = 2; i <= n; i++)
            {
                if(primeNum[i] == true)
                    Console.Write(i + " ");
            }
            Console.WriteLine();
        }


    }
}